<?php
    class dbLayer
        {
                private static $obj;
                private static $queryCount;
                
                public static function query( $str )
                {
                		self::$queryCount ++;
                        return self::$obj->query( $str );
                }
                
                public static function id()
                {
                        return self::$obj->insert_id();
                }
                
                public static function connect( $param, $type )
                {
                        require_once './lib/pot/OTS.php';
						$types = array('sqlite' => POT::DB_SQLITE, 'mysql' => POT::DB_MYSQL);
                        POT::getInstance()->connect( $types[$type], $param );
                        self::$obj = POT::getInstance()->getDBHandle();
                }
                
                public static function fieldName($name)
                {
                        return self::$obj->fieldName($name);
                }
                
                public static function limit($limit = false, $offset = false)
                {
                        return self::$obj->limit($limit, $offset);
                }
        }
?>
